<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}Flask 应用{% endblock %}</title>
     <!-- Bootstrap CSS -->
    <link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">

    <style>
        body {
            background-color: #f8f9fa;
        }
        .card {
            border-radius: 0.5rem;
        }
        pre {
            white-space: pre-wrap;
            word-wrap: break-word;
        }
    </style>
</head>
<body>
    <div class="container py-4">
        {% with messages = get_flashed_messages() %}
            {% if messages %}
                <div class="alert alert-dismissible alert-{{ messages[0].category if messages[0].category else 'info' }}" role="alert">
                    <div class="d-flex align-items-center">
                        <i class="bi bi-exclamation-triangle-fill me-2"></i>
                        <div>
                            {% for message in messages %}
                                <div>{{ message }}</div>
                            {% endfor %}
                        </div>
                    </div>
                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                </div>
            {% endif %}
        {% endwith %}

        <header class="mb-4">
            {% block header %}{% endblock %}
        </header>

        <main>
            {% block content %}{% endblock %}
        </main>
    </div>

    <!-- Bootstrap JS -->
    <script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script>
</body>
</html>